<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page isELIgnored="false" %>
<%@ include file="/WEB-INF/views/common/includes.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="m4f" uri="/WEB-INF/tld/m4f-dataTable.tld" %>

<script type="text/javascript" src="<c:url value='/static/dataTables/media/js/jquery.dataTables.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/static/dataTables/media/js/jquery.dataTables.columnFilter.js'/>"></script>
<script type="text/javascript" src="<c:url value='/static/js/jquery.switchify-1.0.js'/>"></script>

<script type="text/javascript">
function make_crud_actions(oObj) {
	var id = oObj.aData['id'];
	
	var detailAction = '<a href="<c:url value="/${rc.locale.language}/admin/company/detail/"/>' + id + '">Detail</a>';
	var editAction = '<a href="<c:url value="/${rc.locale.language}/admin/company/edit/"/>' + id + '">Edit</a>';
	var deleteAction = '<a href="<c:url value="/${rc.locale.language}/admin/company/delete/"/>' + id + '">Delete</a>';
	
	return detailAction + "&nbsp;&nbsp;" + editAction + "&nbsp;&nbsp;" + deleteAction ; 
}

</script>

<div class="span-16 last table">	
	<m4f:datatable styleId="companies" ajaxUriSource="/es/admin/company/list/table">
		<m4f:datacol i18nName="id" dataProp="id"/>
		<m4f:datacol i18nName="name" dataProp="name"/>
		<m4f:datacol i18nName="actions" dataProp="actions" renderCallback="make_crud_actions"/>
	</m4f:datatable>
</div>
<div class="span-16 last table_actions">			
  <a href='<c:url value='/${rc.locale.language}/admin/company/'/>' title='<fmt:message key="action.company.add" />'><fmt:message key="action.company.add"/></a>
</div>